$.ajax({
  url: '/api/list',
  success(result) {
    console.log(result)
    // let htmlStr = '<ul>'
    // $.each(result.data, (index, value) => {
    //   htmlStr += `<li>${value}</li>`
    // })
    // htmlStr += '</ul>'
    // $('#list').html(htmlStr)

    let templateStr = `
      <ul>
        {{each data}}
        <li>
          {{$value}}
        </il>
        {{/each}}
      </ul>
    `
    let htmlStr = template.render(templateStr, {data: result.data});
    $('#list').html(htmlStr)
  },
  error: function(error) {
    console.log(error)
  }
})